<template>
    <div class="log">
        <div class="top">
            <span class="textbutton" v-if="but.has('addRole')" @click="() => router.push('addRole')">
                ({{ pList.total }})
                {{ but.get('addRole') }}
            </span>
        </div>
        <bList :instance="pList"></bList>
    </div>
</template>
<script setup lang="ts">
import bList from "@m/components/public/b_list.vue";
import { Rolelist } from '@b/index/role'
import { pagebuttonStore } from "@b/store";
import { useRouter } from "vue-router";
const router = useRouter()
const pList = new Rolelist()
const but = pagebuttonStore().button
pList.onShowEdit = (id) => {
    router.push('updateRole?id=' + id)
}
</script>

<style scoped>
.log .top {
    background-color: var(--van-background-2);
    padding: 10px;
}

.log :deep(.van-cell) {
    justify-content: space-between;
}

.log :deep(.van-cell__title) {
    flex-grow: 0;
    min-width: 5em;
    white-space: nowrap;
}
</style>